UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YjtVZ+O4BpLO5uzJHcCS4JPv5UsAJQeEDf01q1tR7QA=' 
WHERE 
  key_id = 'c0c71b0987a965808f7f8579b04454bd25627095e990302ffee8668380e990c3' 
  AND (
    token = 'YjtVZ+O4BpLO5uzJHcCS4JPv5UsAJQeEDf01q1tR7QA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031