UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wwxrHiMe1NVD99Jbi/BHzLvdQ3CxOXLsWTSiO0kuWDo=' 
WHERE 
  key_id = '5cecfc6f8210de6df00b53a93acef9a46b0bb34eb31cbdaefe5baa730d2051ee' 
  AND (
    token = 'wwxrHiMe1NVD99Jbi/BHzLvdQ3CxOXLsWTSiO0kuWDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034