UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HT89FkO7PJxpCsQuL/Sub4QqoZhxjshzjQ4QZBr16Ow='
WHERE
key_id = 'a9446403787ca3a5b9208c1bed5287b4f7af1d20d50fdaa676fadf7d7b0fec70'
AND (
token = 'HT89FkO7PJxpCsQuL/Sub4QqoZhxjshzjQ4QZBr16Ow='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)