UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Py4MxbTzMwrXHENYyzPxT+78xQUzD1TpZ4cQXR7hEkI='
WHERE
key_id = 'dbab711b144402b6318dbfa5b98202b26f3e9e46d0834426f75a5935b1dda433'
AND (
token = 'Py4MxbTzMwrXHENYyzPxT+78xQUzD1TpZ4cQXR7hEkI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)