UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rai2k2BAtYoHK6ad1NA9ZA6C1ThSZOjiS7KdeBqidm8=' 
WHERE 
  key_id = 'da28b1ada50c1a08c38e225745c2d217021189824f9a8456b2f7da7faa0c6fda' 
  AND (
    token = 'Rai2k2BAtYoHK6ad1NA9ZA6C1ThSZOjiS7KdeBqidm8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035