UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Km7sHW3ZyyRm+/564loEdSUxP1YSzO+ZVNFlZhsPPwc='
WHERE
key_id = '4d8af39f17cc008779a2208ece5d01cda040f614761defb5d78ee5e967eb49c5'
AND (
token = 'Km7sHW3ZyyRm+/564loEdSUxP1YSzO+ZVNFlZhsPPwc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)