UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MSw1R/+Nai4JOIB/gQttdpoNxdAK7rtQLb1XrtAJlyw='
WHERE
key_id = '43d506963a0a469593d367f84da9d2c9fb9fa129da9281df0e1a53838aa86ff6'
AND (
token = 'MSw1R/+Nai4JOIB/gQttdpoNxdAK7rtQLb1XrtAJlyw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)