UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'poww7zw4LOGHzxhHf6zhwbg5pKd4LxARp+ENv2W3XKE=' 
WHERE 
  key_id = 'b988c599deb34dc0158142625f9910603275315f660c1179ef083eaead46f207' 
  AND (
    token = 'poww7zw4LOGHzxhHf6zhwbg5pKd4LxARp+ENv2W3XKE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062