UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G+cz3LYgR+1uCQSbNK4FPGnxyysiM1gbBatwyqVabjQ=' 
WHERE 
  key_id = '35b5ce881929b1f51755020bf8cb7b3e8cb81aa455eb0b28e4635d9152485695' 
  AND (
    token = 'G+cz3LYgR+1uCQSbNK4FPGnxyysiM1gbBatwyqVabjQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053