UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2b6bK7rAcAUf0l+3mJS+mOiButOsVpx0ztWIrrXICGs='
WHERE
key_id = 'e301394fcc68e75fc84687619cb4117220494b909de99c54a0ba894f994c130e'
AND (
token = '2b6bK7rAcAUf0l+3mJS+mOiButOsVpx0ztWIrrXICGs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)