UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9lR//Lj6RT9WlBIgcZY/GpJDUu1hgKGoG0LUFGNFSd0='
WHERE
key_id = '7408e6096931693bda8da510c42908bbd9919535fff93893b329216526a78795'
AND (
token = '9lR//Lj6RT9WlBIgcZY/GpJDUu1hgKGoG0LUFGNFSd0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)