UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'npY4qjGxI01u/kFfcTSBFEcD9HtBehsbwR7qFuR/ycE='
WHERE
key_id = '8e8a04470f6af1e4ce0f2ecb2ebb25feffaaeb0a1e501e9b385f9f6b968d24ac'
AND (
token = 'npY4qjGxI01u/kFfcTSBFEcD9HtBehsbwR7qFuR/ycE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)