UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dWRn9PdxP18OQM9uMPsY5aN7pcgJdrOZGosHMUkc6/Y='
WHERE
key_id = '4b04989520fd6110e0298aa5344825d3c4261380c5cdd703a4b45156e73d3e40'
AND (
token = 'dWRn9PdxP18OQM9uMPsY5aN7pcgJdrOZGosHMUkc6/Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)