UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'trC8+LUkOGNckFMXv5oDY/yCG4XzSmDJ+HLbCdH4NxU='
WHERE
key_id = '41955f7d951f9917cb0f740b7048a27b1089801e2fd7bd1d8a41bad32a452a92'
AND (
token = 'trC8+LUkOGNckFMXv5oDY/yCG4XzSmDJ+HLbCdH4NxU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)