UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VMTRBpnFbwSBdW0e0HPeWRDJhUjCtU++CUsE3YiLyiw=' 
WHERE 
  key_id = '9155f89bbcc766e4d50214ba75ed0c7a53c5b6442d0e418f63d8beafc0c18239' 
  AND (
    token = 'VMTRBpnFbwSBdW0e0HPeWRDJhUjCtU++CUsE3YiLyiw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023