UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o6x4Z1KSyT9E/cSupUNS5gS4hBTo5MnHZIYYS2a/7qM='
WHERE
key_id = 'c3c5d49c7e130024e6a4c0847d0d122384779dd39a98df2ff303067dea3d0901'
AND (
token = 'o6x4Z1KSyT9E/cSupUNS5gS4hBTo5MnHZIYYS2a/7qM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)