UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WmpggQC2z9r7AAi+u8r7/JfVcgZXTt2DZFldPRQ4fpk='
WHERE
key_id = '8ee5cea32d5e9e62dc4a241613713f764fe7f6b7dd956221e2199a2e141f4177'
AND (
token = 'WmpggQC2z9r7AAi+u8r7/JfVcgZXTt2DZFldPRQ4fpk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)