UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wu2rIRYaDbDzZz/3/dbrCo/dPekUzqSEElcNJ7Q0E/I=' 
WHERE 
  key_id = '8d77a29af21b10129c015ef752c58d6e179363c10629c3e8fbba9fbe67bfe5f3' 
  AND (
    token = 'Wu2rIRYaDbDzZz/3/dbrCo/dPekUzqSEElcNJ7Q0E/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023