UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WMZE3xBMTzsBgBHuhHgNhrQUqN1lozUwO2jXTCgcV1E=' 
WHERE 
  key_id = 'a492078d95a6d50a4fed051fa3b74290d49bf9f8a5ae94c28b8f49f8521a8bb8' 
  AND (
    token = 'WMZE3xBMTzsBgBHuhHgNhrQUqN1lozUwO2jXTCgcV1E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038