UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TEQQxqby5t10HypsZPG8t6xNrhBfu7CFo4INeyPHZSY=' 
WHERE 
  key_id = '3b52ba8a54c05e800537def61b804e2b1a26471b4434db7dd881eeb8912f1c6c' 
  AND (
    token = 'TEQQxqby5t10HypsZPG8t6xNrhBfu7CFo4INeyPHZSY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020