UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uswZRVxKyrOw+ex2iRcPiPW33ZWzYKLIcj4cp50lk4M=' 
WHERE 
  key_id = 'f20a1242611c7df2a77ecd1d22ef6302f9da3279fc29ed116d09709cc0f31f55' 
  AND (
    token = 'uswZRVxKyrOw+ex2iRcPiPW33ZWzYKLIcj4cp50lk4M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037