UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LPhY/Sk3fyQv1DClVN4axvQ/9Bm6r96h/yES4yhwJpw='
WHERE
key_id = 'e089057a1859c1a9b74b05529ae2fcc754660ea1d6aab0dc88579291b07fb71a'
AND (
token = 'LPhY/Sk3fyQv1DClVN4axvQ/9Bm6r96h/yES4yhwJpw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)