UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WILy1jaMjLv/It93Ckq5SkEduToTMAAGsMeB6fwwNac=' 
WHERE 
  key_id = '11ee681b9264221cc9287c95a825aa509e2f5913d98678956638fd52cf2a5d43' 
  AND (
    token = 'WILy1jaMjLv/It93Ckq5SkEduToTMAAGsMeB6fwwNac=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00070