UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ic0CFmzs7iruYi8IGKLRNHkxCLCdr+5NevDKS8Sdf5o='
WHERE
key_id = 'bade9ab7b1cd735d780f4d95d63765e8e07f578ebb69bf0efcb9692b16d1b080'
AND (
token = 'ic0CFmzs7iruYi8IGKLRNHkxCLCdr+5NevDKS8Sdf5o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)