UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NyFMa5Q0y8PsZJX2eVgwiU8CguaY0yUsW06yvMSm+k0='
WHERE
key_id = '86b7c4e114c5ab1ef8c660d4d2758f43dffa0a7236d4c30406cad464ae8c9976'
AND (
token = 'NyFMa5Q0y8PsZJX2eVgwiU8CguaY0yUsW06yvMSm+k0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)