UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v0DAMYdCEwHU96T5OqH+vrQupKC69yXS+LwczHjY0zU='
WHERE
key_id = '5c3495427e4f523ce1cba07326c516043699c2d2515384872239c68e79c39def'
AND (
token = 'v0DAMYdCEwHU96T5OqH+vrQupKC69yXS+LwczHjY0zU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)