UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yw1e3umyiBiWFUqtXuufGMSMIrbE+4pnDuVIQ62puOE='
WHERE
key_id = '66d5999751e10ce83db87c8f60f6475a5eb503e0eadc912d9bc2890d40b53b05'
AND (
token = 'Yw1e3umyiBiWFUqtXuufGMSMIrbE+4pnDuVIQ62puOE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)