UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rVMSEuDeowiuDLFPz5uOGhQ/SRpxKBm007OBSRa6R7k='
WHERE
key_id = '1b5ce5792244c0f5feb2d027d3046b4db0482ca4e3676f7d7f1e813e5212d1e2'
AND (
token = 'rVMSEuDeowiuDLFPz5uOGhQ/SRpxKBm007OBSRa6R7k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)