UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'URYXkB7jp6/rKrTjG9tO7COE0vQBT0n2y5Sf27qUHjY='
WHERE
key_id = '028d5912792c79abdf38ec7d3f92c71098a2d9d47ba6559c0718e812d943a623'
AND (
token = 'URYXkB7jp6/rKrTjG9tO7COE0vQBT0n2y5Sf27qUHjY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)