UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'usCO5do/a23hFl/tcU/SS4567pha4+FNfXhLmctuo18=' 
WHERE 
  key_id = 'f4294fcc6eab7143f5bc5976efe62305428da6d9dfc0c1c69bfc13b3dc61cc04' 
  AND (
    token = 'usCO5do/a23hFl/tcU/SS4567pha4+FNfXhLmctuo18=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041