UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cO9pRbwNIAk2eShnRncHs6KPkCnxUXSU/anB21YOJj4='
WHERE
key_id = '5b3ac8192ba1b2e6b6c54fd220f78a806170ac97eea49f49431eaac113029e6a'
AND (
token = 'cO9pRbwNIAk2eShnRncHs6KPkCnxUXSU/anB21YOJj4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)