UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZdlBXIsJK9TsYq3YQL3b+tzeP8xELH4AqqNp7KrRqes=' 
WHERE 
  key_id = '7b372c8779a0ded8fbd7dae8f2efd46db6ffe94b618aa38056217dae04362d18' 
  AND (
    token = 'ZdlBXIsJK9TsYq3YQL3b+tzeP8xELH4AqqNp7KrRqes=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028