UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'irwJWS3YbwFDpGhuBTtGicVLCeg5OAozNWChNrRiJiQ=' 
WHERE 
  key_id = '342ae118d461bf31a838a51734be66558c0d631960ecd8d2d7fb8e6578f6ba08' 
  AND (
    token = 'irwJWS3YbwFDpGhuBTtGicVLCeg5OAozNWChNrRiJiQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042