UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Dzk2N5PvUA3Ei3GJsJXPngvrN3WLBmlnoGKsChU0p2k='
WHERE
key_id = 'e4130fd5ea7de4032d01b521c1cd413b00c00ac98ae69aad3ec7cd4b57275077'
AND (
token = 'Dzk2N5PvUA3Ei3GJsJXPngvrN3WLBmlnoGKsChU0p2k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)