UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vvPnyI3qW2lcLWPXCJoZO5Cw42F+JXs//e/Ue99LYCs=' 
WHERE 
  key_id = '13a79ed531394b2fa98982dfc4e6765a62a2dd1fc437415b288e50695fb402a7' 
  AND (
    token = 'vvPnyI3qW2lcLWPXCJoZO5Cw42F+JXs//e/Ue99LYCs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023