UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '77bNQYtVhCMcwYtSoawcO8a+0aYJCrnk+gBoww4i3Lo='
WHERE
key_id = '8fa28393ff899a96d32e884af2f9afb0840d511eac2fce4145c1701d1bcfbca0'
AND (
token = '77bNQYtVhCMcwYtSoawcO8a+0aYJCrnk+gBoww4i3Lo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)