UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hgOQr/9sh7v3rt6rUo9F1Iqg8Yu+NAHErVMO8ZxTzU0='
WHERE
key_id = '23c91d45bf390a742a9d00b2e7404d8e1833ab237d3e4e85ed58844115362b08'
AND (
token = 'hgOQr/9sh7v3rt6rUo9F1Iqg8Yu+NAHErVMO8ZxTzU0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)