UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gSA/EO/huTyBn6e5Sz2CVbMlI5HcomnTCBcUzQhUDtQ='
WHERE
key_id = 'a9bc224ba3700a14a8ab10c1ad57335a8f43d45d7b32dd913e0b5e1cc3860bad'
AND (
token = 'gSA/EO/huTyBn6e5Sz2CVbMlI5HcomnTCBcUzQhUDtQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)