UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HLQ5p6/yjlBN0E2/0wV015poepuVztHkV3IvFjUvg5U='
WHERE
key_id = 'dfa104a85f3f1c7e7958dcab0f082bd1e31d3cdb5769e4b391166a584509a8c5'
AND (
token = 'HLQ5p6/yjlBN0E2/0wV015poepuVztHkV3IvFjUvg5U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)