UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4utMqLQXfXJWmCwXR4VZzjVt2JiPrl8Enui6jYDUxbs=' 
WHERE 
  key_id = '8bc78dbd136f541a929a9732ce9cd0d09c67e87de40b4b6af4ca44ffe35717d7' 
  AND (
    token = '4utMqLQXfXJWmCwXR4VZzjVt2JiPrl8Enui6jYDUxbs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036